// 各省疫情分析
function provices(provincialName) {

  $.getJSON('provincialLocal.do?provincialName='+provincialName, function (data) {
    let xData = [];
    let seriesData = [{
      name: '现有确诊',
      type: 'bar',
      data: []
    }, {
      name: '现有治愈',
      type: 'bar',
      data: []
    }, {
      name: '现有死亡',
      type: 'bar',
      data: []
    }];
    data.forEach((e) => {
      xData.push(e["areaName"]);
      seriesData[0].data.push(e["confirmCount"]);
      seriesData[1].data.push(e["curedCount"]);
      seriesData[2].data.push(e["deadCount"]);
    })
    drow(xData,seriesData);
  })
}

function drow(xData,seriesData) {
  var pie_fanzui = echarts.init(document.getElementById("pie_yiqing"), 'infographic');
  option = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {            // 坐标轴指示器，坐标轴触发有效
        type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
      }
    },
    legend: {
      data: ['现有确诊', '现有治愈', '现有死亡']
    },

    grid: {
      left: '1%',
      right: '1%',
      bottom: '1%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        data: xData
      }
    ],
    yAxis: [
      {
        type: 'value'
      }
    ],
    series: seriesData
  };

  pie_fanzui.setOption(option);
}